new Vue({
    el: '#app',
    mixins: [Save],//组件配置文件，路径/utils/components.js
    data() {
        return {
            dataForm: {
                Number: 1
            },
        }
    },
    mounted() {
        /**
         * 组件配置文件中自动执行方法
         * 1.this.init(); //初始化文件
         * 2.this.getData(); //仅修改时执行，根据BOM配置属性查询
         */
    },
    methods: {
        async handleSubmit() {
            this.loading = true;
            // console.log(this.dataForm.Number);
            let warehouse_pallet = [];
            for (let palletIndex = 1; palletIndex <= this.dataForm.Number; palletIndex++) {
                warehouse_pallet.push({ Row_Status: 2 });
            }
            let lJSONObject_DataSet = {
                Add: {
                    warehouse_pallet: warehouse_pallet
                },
            }
            let Operation_Main = JSON.stringify(deepClone(lJSONObject_DataSet));
            lJSONObject_DataSet['Add']['base_operation_log'] = [{
                Operation_Type: '0',
                Operation_Path: getRelativePath(),
                Operation_Description: '保存（新增/修改）数据',
                Operation_Main,
                Operation_Interface: "generalSaveByRequestBody",
                Operation_IP: getIpAddress()
            }]
            try {
                const res = await generalApi.generalSaveByRequestBody({
                    Data: lJSONObject_DataSet
                })
                if (res.Status == 'success') {
                    this.$message.success("提交成功");
                    window.location.href = './index.html';
                } else {
                    this.$message.error("提交失败，请重试！");
                }
            } catch (error) {
                console.error(error);
            }
            this.loading = false;
        },
    }
})